﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CustomerRegistration.aspx.cs" Inherits="AeroLine.CustomerRegistration" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script language="javascript" type="text/javascript">
    function validateLength(source, arguments) {
        arguments.IsValid = false;
        if (arguments.Value.length > 9)
            return;
        arguments.IsValid = true;
    }
</script>
    <title></title>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 131px;
            text-align: left;
        }
        .style3
        {
            width: 341px;
            text-align: left;
        }
        .style4
        {
            width: 131px;
            text-align: left;
            height: 130px;
        }
        .style5
        {
            width: 341px;
            text-align: left;
            height: 130px;
        }
        .style6
        {
            height: 130px;
            text-align: left;
        }
        .style7
        {
            text-align: left;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div style="text-align: center">
    
        <h2>
    
        <asp:Label ID="Label1" runat="server" style="text-align: center; font-weight: 700; font-size: large;" 
            Text="Customer Registration Form"></asp:Label>
        </h2>
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" />
        <br />
        <table class="style1">
            <tr>
                <td class="style2" style="text-align: left">
                    <asp:Label ID="lblLoginName" runat="server" style="text-align: left" 
                        Text="Login Name:"></asp:Label>
                </td>
                <td class="style3">
                    <asp:TextBox ID="txtbox_Login" runat="server" 
                        ontextchanged="txtbox_Login_TextChanged"></asp:TextBox>
                </td>
                <td class="style7">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="txtbox_Login" ErrorMessage="Please Enter a Login Name" 
                        Display="Dynamic" ToolTip="Please Enter a Login Name">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label2" runat="server" Text="Password:"></asp:Label>
                </td>
                <td class="style3">
                    <asp:TextBox ID="txtbox_Password" runat="server"></asp:TextBox>
                </td>
                <td class="style7">
                    <asp:CompareValidator ID="validator_Password" runat="server" 
                        ErrorMessage="Password Mismatch" ControlToCompare="txtbox_Password" 
                        ControlToValidate="txtConfirmPassword" ForeColor="Red" Display="Dynamic" 
                        ToolTip="Password Mismatch">*</asp:CompareValidator>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                        ControlToValidate="txtbox_Password" ErrorMessage="Please Enter a Password" 
                        Display="Dynamic" ToolTip="Please Enter a Password">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label3" runat="server" Text="Confirm Password:"></asp:Label>
                </td>
                <td class="style3">
                    <asp:TextBox ID="txtConfirmPassword" runat="server"></asp:TextBox>
                </td>
                <td class="style7">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                        ControlToValidate="txtConfirmPassword" 
                        ErrorMessage="Please Re-type your Password" Display="Dynamic" 
                        ToolTip="Please Re-type your Password">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label4" runat="server" Text="Singapore IC:"></asp:Label>
                </td>
                <td class="style3">
                    <asp:TextBox ID="txtIC" runat="server"></asp:TextBox>
                </td>
                <td class="style7">
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                        ControlToValidate="txtIC" ErrorMessage="Please Enter a Valid IC" 
                        ForeColor="Red" ValidationExpression="^[SFTG]\d{7}[A-Z]$" 
                        Display="Dynamic" ToolTip="Please Enter a Valid IC">*</asp:RegularExpressionValidator>
                    <asp:CustomValidator ID="CustomValidator1" runat="server" 
                        ClientValidationFunction="validateLength" 
                        ErrorMessage="The IC should be 9 characters long" 
                        ControlToValidate="txtIC" Display="Dynamic" 
                        ToolTip="The IC should be 9 characters long">*</asp:CustomValidator>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label5" runat="server" Text="Passport No:"></asp:Label>
                </td>
                <td class="style3">
                    <asp:TextBox ID="txtPassport" runat="server"></asp:TextBox>
                </td>
                <td class="style7">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                        ControlToValidate="txtPassport" 
                        ErrorMessage="Please Enter your Passport Number" Display="Dynamic" 
                        ToolTip="Please Enter your Passport Number">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label6" runat="server" Text="Full Name:"></asp:Label>
                </td>
                <td class="style3">
                    <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
                </td>
                <td class="style7">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                        ControlToValidate="txtName" ErrorMessage="Please Enter Your Name" 
                        Display="Dynamic" ToolTip="Please Enter Your Name">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label7" runat="server" Text="Phone No:"></asp:Label>
                </td>
                <td class="style3">
                    <asp:TextBox ID="txtPhoneNo" runat="server"></asp:TextBox>
                </td>
                <td class="style7">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                        ControlToValidate="txtPhoneNo" ErrorMessage="Please Enter a Phone Number" 
                        Display="Dynamic" ToolTip="Please Enter a Phone Number">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label8" runat="server" Text="Gender:"></asp:Label>
                </td>
                <td class="style3">
                    <asp:RadioButton ID="rbdMale" runat="server" Checked="True" GroupName="gender" 
                        Text="Male" />
                    <asp:RadioButton ID="rbdFemale" runat="server" GroupName="gender" 
                        Text="Female" />
                </td>
                <td class="style7">
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style4">
                    <asp:Label ID="Label9" runat="server" Text="Date of Birth:"></asp:Label>
                </td>
                <td class="style5">
                    <asp:TextBox ID="txtDOB" runat="server"></asp:TextBox>
                    <asp:ImageButton ID="btnCalendar" runat="server" Height="22px" 
                        ImageUrl="~/Images/calendar.png" onclick="ImageButton1_Click" Width="27px" />
                </td>
                <td class="style6">
                    <asp:Calendar ID="Calendar_DOB" runat="server" 
                        onselectionchanged="Calendar_DOB_SelectionChanged" Visible="False">
                    </asp:Calendar>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label10" runat="server" Text="Email:"></asp:Label>
                </td>
                <td class="style3">
                    <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
                </td>
                <td class="style7">
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                        ControlToValidate="txtEmail" ErrorMessage="Please Enter a Valid Email ID" 
                        ForeColor="Red" 
                        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" 
                        Display="Dynamic" ToolTip="Please Enter a Valid Email ID">*</asp:RegularExpressionValidator>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                        ControlToValidate="txtEmail" 
                        ErrorMessage="Please Enter your Email Address" Display="Dynamic" 
                        ToolTip="Please Enter your Email Address">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label11" runat="server" Text="Address:"></asp:Label>
                </td>
                <td class="style3">
                    <asp:TextBox ID="txtAddress" runat="server" TextMode="MultiLine"></asp:TextBox>
                </td>
                <td class="style7">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                        ControlToValidate="txtAddress" ErrorMessage="Please Enter your Address" 
                        Display="Dynamic" ToolTip="Please Enter your Address">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label12" runat="server" Text="Counrty:"></asp:Label>
                </td>
                <td class="style3">
                    <asp:DropDownList ID="ddl_Country" runat="server">
                        <asp:ListItem>Singapore</asp:ListItem>
                        <asp:ListItem>India</asp:ListItem>
                        <asp:ListItem>China</asp:ListItem>
                        <asp:ListItem>Myanmar</asp:ListItem>
                        <asp:ListItem>Malaysia</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td class="style7">
                    &nbsp;</td>
            </tr>
        </table>
    
    </div>
    <asp:Button ID="btnSubmit" runat="server" onclick="btnSubmit_Click" 
        Text="Submit" />
    </form>
</body>
</html>
